{% extends 'base.html' %}
{% block content %}

<ul class="breadcrumb">
  <li><a href="/settings/">settings</a></li>
  <li><a href="/settings/#users">users</a></li>
  <li class="active">add new user</li>
</ul>

<div class="container">
  <form action="/users/add" method="post" class="form-horizontal">
    <legend>Add a new user</legend>
      {% csrf_token %}
      {% for field in form %}
          {% if field.errors %}
              <div class="form-group has-error">
                  <label class="col-sm-2 control-label" for="id_{{ field.name }}">{{ field.label }}</label>
                  <div class="col-sm-10">
                      {{ field }}
                      <span class="help-block">
                          {% for error in  field.errors %}{{ error }}{% endfor %}
                      </span>
                  </div>
              </div>
          {% elif not field.is_hidden %}
              <div class="form-group">
                  <label class="col-sm-2 control-label" for="id_{{ field.name }}">{{ field.label }}</label>
                  <div class="col-sm-10">
                      {{ field }}
                      {% if field.help_text %}
                          <p class="help-block"><small>{{ field.help_text }}</small></p>
                      {% endif %}
                  </div>
              </div>
          {% endif %}
      {% endfor %}
      <div class="form-group">
        <button type="submit" class="btn btn-primary">Submit</button>
        <a href="/settings/#users" class="btn btn-primary">Cancel</a>
      </div>
  </form>
</div>

{% endblock %}
